Struct isotope_parser::prettyprint::Arena [−]
pub struct Arena<'a, A = ()> { /* fields omitted */ }
Expand description
An arena which can be used to allocate Doc
values.
Implementations
Trait Implementations
impl<'a, A> DocAllocator<'a, A> for Arena<'a, A>
impl<'a, A> DocAllocator<'a, A> for Arena<'a, A>
pub fn alloc(
&'a self,
doc: Doc<'a, <Arena<'a, A> as DocAllocator<'a, A>>::Doc, A>
) -> <Arena<'a, A> as DocAllocator<'a, A>>::Doc
pub fn alloc_column_fn(
&'a self,
f: impl Fn(usize) -> <Arena<'a, A> as DocAllocator<'a, A>>::Doc + 'a
) -> <<Arena<'a, A> as DocAllocator<'a, A>>::Doc as DocPtr<'a, A>>::ColumnFn
pub fn alloc_width_fn(
&'a self,
f: impl Fn(isize) -> <Arena<'a, A> as DocAllocator<'a, A>>::Doc + 'a
) -> <<Arena<'a, A> as DocAllocator<'a, A>>::Doc as DocPtr<'a, A>>::WidthFn
fn nil(&'a self) -> DocBuilder<'a, Self, A>
fn nil(&'a self) -> DocBuilder<'a, Self, A>
Allocate an empty document.
fn fail(&'a self) -> DocBuilder<'a, Self, A>
fn fail(&'a self) -> DocBuilder<'a, Self, A>
Fails document rendering immediately. Read more
fn hardline(&'a self) -> DocBuilder<'a, Self, A>
fn hardline(&'a self) -> DocBuilder<'a, Self, A>
Allocate a single hardline.
fn space(&'a self) -> DocBuilder<'a, Self, A>
fn line(&'a self) -> DocBuilder<'a, Self, A>
fn line(&'a self) -> DocBuilder<'a, Self, A>
A line acts like a \n
but behaves like space
if it is grouped on a single line.
fn line_(&'a self) -> DocBuilder<'a, Self, A>
fn line_(&'a self) -> DocBuilder<'a, Self, A>
Acts like line
but behaves like nil
if grouped on a single line Read more
fn softline(&'a self) -> DocBuilder<'a, Self, A>
fn softline(&'a self) -> DocBuilder<'a, Self, A>
A softline
acts like space
if the document fits the page, otherwise like line
fn softline_(&'a self) -> DocBuilder<'a, Self, A>
fn softline_(&'a self) -> DocBuilder<'a, Self, A>
A softline_
acts like nil
if the document fits the page, otherwise like line_
fn as_string<U>(&'a self, data: U) -> DocBuilder<'a, Self, A> where
U: Display,
fn as_string<U>(&'a self, data: U) -> DocBuilder<'a, Self, A> where
U: Display,
Allocate a document containing the text t.to_string()
. Read more
fn text<U>(&'a self, data: U) -> DocBuilder<'a, Self, A> where
U: Into<Cow<'a, str>>,
fn text<U>(&'a self, data: U) -> DocBuilder<'a, Self, A> where
U: Into<Cow<'a, str>>,
Allocate a document containing the given text. Read more
fn concat<I>(&'a self, docs: I) -> DocBuilder<'a, Self, A> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<BuildDoc<'a, Self::Doc, A>>,
fn concat<I>(&'a self, docs: I) -> DocBuilder<'a, Self, A> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<BuildDoc<'a, Self::Doc, A>>,
Allocate a document concatenating the given documents.
fn intersperse<I, S>(&'a self, docs: I, separator: S) -> DocBuilder<'a, Self, A> where
I: IntoIterator,
S: Into<BuildDoc<'a, Self::Doc, A>> + Clone,
<I as IntoIterator>::Item: Into<BuildDoc<'a, Self::Doc, A>>,
fn intersperse<I, S>(&'a self, docs: I, separator: S) -> DocBuilder<'a, Self, A> where
I: IntoIterator,
S: Into<BuildDoc<'a, Self::Doc, A>> + Clone,
<I as IntoIterator>::Item: Into<BuildDoc<'a, Self::Doc, A>>,
Allocate a document that intersperses the given separator S
between the given documents
[A, B, C, ..., Z]
, yielding [A, S, B, S, C, S, ..., S, Z]
. Read more
fn column(
&'a self,
f: impl Fn(usize) -> Self::Doc + 'a
) -> DocBuilder<'a, Self, A>
fn column(
&'a self,
f: impl Fn(usize) -> Self::Doc + 'a
) -> DocBuilder<'a, Self, A>
Allocate a document that acts differently based on the position and page layout Read more